package cn.yunhe.pojo;

import javax.persistence.*;
import java.io.Serializable;

@Entity(name = "街道")
@Table(name = "street")
public class Street implements Serializable {
    private int sid;
    private String sname;
    private District district;

    public Street() {
    }

    public Street(String sname) {
        this.sname = sname;
    }

    public Street(String sname, District district) {
        this.sname = sname;
        this.district = district;
    }

    public Street(int sid, String sname, District district) {
        this.sid = sid;
        this.sname = sname;
        this.district = district;
    }
    @Id
    @GeneratedValue
    @Column(name = "sid")
    public int getSid() {
        return sid;
    }


    public void setSid(int sid) {
        this.sid = sid;
    }
    @Column(name = "sname")
    public String getSname() {
        return sname;
    }


    public void setSname(String sname) {
        this.sname = sname;
    }

    @ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
    @JoinColumn(name = "sdid")
    public District getDistrict() {
        return district;
    }

    public void setDistrict(District district) {
        this.district = district;
    }
}
